<div ng-controller="taskList" class="bills">

	<div class="bill-btn-line clearfix bill-border-line">
		<div ng-class="{'bill-line':true, 'clearfix':true, 'trade-line':module == 'trade'}">
			<div ng-if="submodule == 'receive'" class="bill-input">
				<label id="xxx">{{lang.customer_name}}</label>
				<p>
					<input type="text" ng-model="customer_ids" ng-click="resetUserList()" ng-mouseover="initUserList()" id="userList_{{num}}"  readonly="true" />
				</p>
			</div>
			<div ng-if="submodule == 'pay'" class="bill-input">
				<label id="xxx">供应商</label>
				<p>
					<input readonly="readonly" type="text" ng-model="customerName" ng-value="customerValue" ng-click="getSupplier()" id="select-supplier" readonly="true" />
				</p>
			</div>
			<div ng-if="module == 'trade'" class="bill-input">
				<label>平台实体</label>
				<p>
					<input type="text" id="select-platform" ng-model="platform" ng-value="platformValue" ng-click="getPlatform();" readonly="true" />
					<i class="select-icon icon-drop-down"></i>
				</p>
			</div>
			<div class="bill-input bill-inputs">
				<label>{{lang.bill_time}}</label>
				<input type="text" id="begin-time" ng-value="startEffectTime" ng-model="startEffectTime"  />
				<span>~</span>
				<input type="text" id="finish-time" ng-value="endEffectTime"  ng-model="endEffectTime" />
			</div>
		</div>
		<div class="bill-btn">
			<button class="btn btn-primary btn-bill" ng-click="generateBills()" ng-disabled="!startEffectTime || !endEffectTime">{{lang.generate_bills}}</button>
		</div>
	</div>

	<div class="bill-btn-line clearfix">
		<div class="bill-line clearfix">
			<div class="bill-input">
				<label>{{lang.task_code}}</label>
				<input type="text" ng-model='search.taskCode' ng-change='changetaskCode($event)' maxlength="30"  />
			</div>

			<div class="bill-input bill-inputs">
				<label>{{lang.task_time}}</label>
				<input type="text" id="taskStartTime" ng-value="search.taskStartTime" ng-model="search.taskStartTime" />
				<span>~</span>
				<input type="text" id="taskEndTime" ng-value="search.taskEndTime" ng-model="search.taskEndTime" />
			</div>
		</div>
	</div>

	<div class="bill-btn-line clearfix">
		<div class="bill-line clearfix">
			<div class="bill-input bill-status">
				<label>{{lang.status}}</label>
				<p>
					<input type="text" id="task_status_{{num}}" ng-model='taskStatusName' />
					<i class="select-icon icon-drop-down"></i>
				</p>
			</div>
			<div class="bill-input bill-inputs">
				<label>{{lang.bill_time}}</label>
				<input type="text" id="startEffectTime" ng-value="search.startEffectTime" ng-model="search.startEffectTime"  />
				<span>~</span>
				<input type="text" id="endEffectTime" ng-value="search.endEffectTime" ng-model="search.endEffectTime" />
			</div>
		</div>
		<div class="bill-btn">
			<span class="clear-search" ng-click="clearSearch()" style="margin:0px 10px;">重置</span>
			<button class="btn btn-primary btn-bill" ng-click="searchTaskList()">{{lang.search}}</button>
		</div>
	</div>

	<div class="btn-group">
		<button class="btn btn-primary btn-bill" ng-click="deleteTask()" ng-disabled="canDel('COMPLETED')">{{lang.delete}}</button>
		<button class="btn btn-primary btn-bill" ng-click="repeatGenerateBills()" ng-disabled="canDel('SUSPEND')">{{lang.retry}}</button>
	</div>

	<div class="table-container" ng-controller="tableController">
            <table class="customer-table table-box" cellpadding="0" cellspacing="0">
                <thead>
                <tr>
                    <th style="width:5%">
                        <div class="checkbox checkbox-info">
                            <input type="checkbox" ng-model="tableModel.selectFlag" ng-click="table.selectAll(tableModel);">
                            <label></label>
                        </div>
                    </th>
                    <th style="width:{{tableModel.tableHeaderSize[$index]}}" ng-repeat="item in tableModel.tableHeader">{{item}}</th>
                </tr>
                </thead>

                <tbody id="taskTable">
                <tr ng-repeat="value in tableModel.tableBody" ng-init="renderFinish($last)">
                    <td>
                        <i ng-show="value.isLocked" class="icon-lock lock"></i>
                        <div class="checkbox checkbox-info">
                            <input type="checkbox" ng-checked="value.checkbox" ng-click="table.selectOne(tableModel, value.checkboxId, $event);">
                            <label></label>
                            <span class="state-code" style="display: none;">{{value.status}}</span>
                        </div>
                    </td>
                    <td>{{(tableModel.pagination.currentPage-1)*tableModel.pagination.pageSize+$index+1}}</td>
                    <td>{{value.taskCode}}</td>
                    <td>{{value.startEffectTime || '-'}}</td>
                    <td>{{value.endEffectTime || '-'}}</td>
                    <td>
                    		<span ng-if="value.quantityTxt != 100">{{value.quantityTxt}}%</span>
                    		<a href="javascript:void(0)" ng-click="getTaskDetail(value.taskCode)" ng-if="value.quantityTxt == 100">
                    			{{value.quantityTxt}}%
                    		</a>
                    </td>
                    <td>{{value.taskStartTime || '-'}}</td>
                    <td>{{value.taskEndTime || '-'}}</td>
                    <td change-status="{{value.taskStatus}}"></td>
                </tr>
                </tbody>
            </table>
            <div ng-show="showTable"><hnapagination table-service="table" page-table-model="tableModel"></hnapagination></div>
            <div ng-show="!tableModel.pagination.isVisiblePage" class="undefinedsvg">
            		<img src="/public/img/undefined.svg">
        	</div>
        </div>

    </div>
